package com.moss.web;

import com.moss.common.core.BaseController;
import com.moss.common.domain.AjaxResult;
import com.moss.common.vo.dashboard.*;
import com.moss.system.service.DashBoardService;
import org.springframework.web.bind.annotation.GetMapping;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import java.util.List;

@RestController
@RequestMapping("/dashboard")
public class DashboardController extends BaseController {

    @Resource
    DashBoardService boardService;


    /**
     * 第一列检测企业排行
     * @param dashboardParams
     * @return
     */
    @GetMapping("/checkCompanyRank")
    public AjaxResult<List<CheckCompanyRank>> checkCompanyRank(DashboardParams dashboardParams){
        return AjaxResult.success(boardService.checkCompanyRank(dashboardParams));
    }

    /**
     * 第二列商品排行
     * @param dashboardParams
     * @return
     */
    @GetMapping("/checkGoodsRank")
    public AjaxResult<List<CheckGoodsRank>> checkGoodsRank(DashboardParams dashboardParams){
        return AjaxResult.success(boardService.checkGoodsRank(dashboardParams));
    }

}
